package org.gongliang.jsmile.authc.mq;


import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.apache.log4j.Logger;
import org.springframework.kafka.listener.MessageListener;


public class KafkaConsumer implements MessageListener<String, String> {

	private Logger logger = Logger.getLogger(KafkaConsumer.class);

	@Override
	public void onMessage(ConsumerRecord<String, String> record) {
		logger.info("KafkaConsumerServer=============kafkaConsumer开始消费=============");
		String topic = record.topic();
		String key = record.key();
		String value = record.value();
		long offset = record.offset();
		int partition = record.partition();
		logger.info("KafkaConsumerServer-------------topic:" + topic);
		logger.info("KafkaConsumerServer-------------value:" + value);
		logger.info("KafkaConsumerServer-------------key:" + key);
		logger.info("KafkaConsumerServer-------------offset:" + offset);
		logger.info("KafkaConsumerServer-------------partition:" + partition);
		logger.info("~~~~~~~~~~~~~kafkaConsumer消费结束~~~~~~~~~~~~~");
		System.out.println("消费成功***************************************************************");

	}
}
